package cn.cdutetc.foxwatch.controller.message;

import cn.cdutetc.foxwatch.pojo.Result;
import cn.cdutetc.foxwatch.serveice.message.MailService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName： MailController.java
 * @ClassPath： com.tansci.controller.message.MailController.java
 * @Description： 邮件
 * @Author： tanyp
 * @Date： 2021/6/7 9:17
 **/
@Slf4j
@RestController
@RequestMapping("/email")
@Tag(name = "email", description = "邮件模板")
public class MailController {
    @Autowired
    private MailService mailService;

    @Operation(summary = "邮箱验证码")
    @PostMapping("/sendCode")
    public Result sendSimple(@RequestBody String recipient) throws Exception {
        mailService.sendCode(recipient);
        return Result.success("邮件发送成功");
    }

}
